#ifndef __USB_DEVFS_H__
#define __USB_DEVFS_H__


//callback functions for USB devfs
struct usb_dev_func
{
	//callback functions for no hub functions
	INT32 (*fusbd_device_read)(UINT8 sub_lun, UINT32 lbn, UINT8* buffer, UINT32 sector_count);
	INT32 (*fusbd_device_write)(UINT8 sub_lun, UINT32 lbn, UINT8* buffer, UINT32 sector_count);

	//callback functions for usb hub functions
	INT32 (*fusbd_device_read_ex)(void* nodeid,UINT8 sub_lun, UINT32 lbn, UINT8* buffer, UINT32 sector_count);
	INT32 (*fusbd_device_write_ex)(void* nodeid, UINT8 sub_lun, UINT32 lbn, UINT8* buffer, UINT32 sector_count);
		
};

struct fs_usb_dev
{
	//device information
	uint32 nodeid;
	uint32 lun;

	//disk information
	int		nSectorSize;
	off_t	nSectors;
	off_t	nStart;
	off_t	nSize;

	//callback functions
	struct usb_dev_func func;
	UINT32 which_port;
    UINT32 host_id;
};


int usb_hdd_init(struct fs_usb_dev *pusb_dev);
int usb_hdd_get_dev(uint32 nodeid, int lun);
int usb_hdd_cleanup(uint32 nodeid, int lun);
int usb_hdd_get_lunlist(uint32 nodeid, int *lunlist, int maxlun);



#endif// __USB_DEVFS_H__




